package com.jian.utils;

import android.content.Context;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;

public class MacUtils
{  
	
	/**
	 * 获取网卡地址
	 */

	private MacUtils(){}
	
	public static String mac = null;

	public  static void getmac(Context c) {
		WifiManager wifiMgr = (WifiManager) c
				.getSystemService(Context.WIFI_SERVICE);
		WifiInfo info = (null == wifiMgr ? null : wifiMgr.getConnectionInfo());
		if (null != info) {
			String a = info.getMacAddress();
			if (null != a) {
				mac = a;
			} else {
				mac = "获取mac失败";
			}
		}
	}

}
